//
//  NYIntroduceViewController.m
//  NiuWaJiaoYu
//
//  Created by MinLison on 2018/1/6.
//  Copyright © 2018年 niuwaketang. All rights reserved.
//

#import "NYIntroduceViewController.h"

#import "NYIntroduceRequest.h"

@interface NYIntroduceViewController ()

@end

@implementation NYIntroduceViewController

#pragma mark - Life Cycle Methods
- (void)dealloc {
    
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    [self initUI];
}
#pragma mark - Intial Methods
- (void)initUI {
    
    [self loadTheDataRequest];
}
#pragma mark - Network Methods
- (void)loadTheDataRequest {
    
    [self setLoading:YES animation:YES];
    
    @weakify(self);
    [[NYIntroduceRequest requestWithParams:nil] startWithSuccess:^(__kindof BaseRequest * _Nonnull request, __kindof NSString * _Nonnull data) {
        
        @strongify(self);
        self.controllerView.htmlString = data;
        [self setSuccess];
    } failed:^(__kindof BaseRequest * _Nonnull request, NSError * _Nonnull error) {
        
        @strongify(self);
        [self setError:error];
        [self.navigationController popViewControllerAnimated:true];
    }];
}

#pragma mark - Target Methods

#pragma mark - Public Methods

#pragma mark - Private Method

#pragma mark - External Delegate

#pragma mark - UITableViewDelegate,UITableViewDataSource

#pragma mark - Setter Getter Methods

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
